﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.Utils.Menu;

namespace Ahi.Base
{
    public partial class DuzenleBaseForm : BaseForm
    {
       public DXPopupMenu menu = new DXPopupMenu();

        public DuzenleBaseForm()
        {
            InitializeComponent();
        }

        public override void Yukle()
        {
            if (Id.HasValue)
            {
                KayitYukle(Id);
            }
            else
            {
                YeniKayit();
            }
            YuklediktenSonraCalistir();
        }

        public virtual void YuklediktenSonraCalistir()
        {
        }

        public virtual void KayitYukle(IdFormParameter Id)
        {
        }

        public virtual void YeniKayit()
        {
        }

        public virtual void Kaydet()
        {
        }

        private void buttonKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Kaydet();
        }

        private void buttonClose_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
            Close();
        }

        private void DuzenleBaseForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control && e.KeyCode == Keys.S)
                Kaydet();
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            Kaydet();
        }
    }
}
